package com.example.server.security.context;

import com.example.common.security.UserDetails;
import org.springframework.stereotype.Component;

@Component
public class TokenBasedSecurityContextHolder implements SecurityContextHolder {

    private final ThreadLocal<UserDetails> USER_DETATLS_HOLDER= new ThreadLocal<>();

    @Override
    public UserDetails getUserDetails() {
        return USER_DETATLS_HOLDER.get();
    }

    @Override
    public void setUserDetails(UserDetails userDetails) {
        USER_DETATLS_HOLDER.set(userDetails);
    }


}
